package com.sanshow.charging.data;

import com.blankj.utilcode.util.SPUtils;
import com.sanshow.charging.util.AppInfoUtils;
import com.sanshow.charging.util.DeviceUtil;
import com.sanshow.charging.util.StringUtil;

import org.json.JSONException;
import org.json.JSONObject;


public class LoginBean extends DefaultSendBean {

    public LoginBean() {
        /*StringBuilder message = new StringBuilder();
        message.append(StringUtil.strTo16("SME").toUpperCase());
        message.append("A0");
        message.append("0F");
        message.append(StringUtil.strTo16("000056"));*/

        String deviceCode = DeviceUtil.getSerialNumber();
        //String hexString = Integer.toHexString(Integer.parseInt(deviceCode));
        String deviceSN = StringUtil.formatWithMakingUp(deviceCode);

        String versionCode = Integer.toHexString(AppInfoUtils.getVersionCode());


        StringBuilder message = new StringBuilder();
        message.append("61");
        message.append("00");
        message.append(deviceSN);
        message.append("A0");
        message.append(versionCode);
        message.append("A0");
        message.append("00");
        message.append("00");
        message.append("00");
        message.append("00");
        message.append("00");
        message.append("00");
        message.append("C1");
        message.append("D1");
        message.append("00");
        message.append("DF");
        message.append("DF");

        content = message.toString();
    }


}
